import { h, Component } from 'preact';
import React, {PropTypes} from 'react';
import Portal from '~/components/Portal';
import s from './style.scss';

function Overlay({ lockScroll, children }) {
	return (
    <Portal lockScroll={lockScroll}>
      <div className={s.root}>{children}</div>
    </Portal>
	);
}

Overlay.propTypes = {
	children: PropTypes.oneOfType([
		PropTypes.arrayOf(PropTypes.node),
		PropTypes.node
	]),
	lockScroll: PropTypes.bool
};
Overlay.defaultProps = {
	lockScroll: true
};

export default Overlay;
